package com.tyros.resource.listener.event;

import com.tyros.common.utils.LogUtils;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent;
import org.springframework.context.ApplicationListener;

/**
 * @author zhangshuaiyin
 * @date 2022/2/23 21:38
 */
@Slf4j
public class ApplicationEnvironmentPreparedEventListener implements ApplicationListener<ApplicationEnvironmentPreparedEvent> {

    @SneakyThrows
    @Override
    public void onApplicationEvent(ApplicationEnvironmentPreparedEvent event) {
        LogUtils.info(log, "ApplicationEnvironmentPreparedEventListener");
        // Path path = Paths.get("D:\\devtools\\env-bats\\redis.bat");
        // Process ps = Runtime.getRuntime().exec("cmd.exe /C start " + path.toAbsolutePath());
        // ps.waitFor();
    }
}
